package com.talkweb.osmharmony.util;

import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;

public final class Log {

    private static final HiLogLabel hiLogLabel = new HiLogLabel(HiLog.LOG_APP, 0x00221, "OSMDroid-OHOS");

    public static void d(String tag, String message) {
        HiLog.debug(hiLogLabel, "[%{public}s] : %{public}s", tag, message);
    }

    public static void d(String tag, String message, Throwable throwable) {
        HiLog.debug(hiLogLabel, "[%{public}s] : %{public}s ===> %{public}s", tag, message, HiLog.getStackTrace(throwable));
    }

    public static void e(String tag, String message) {
        HiLog.error(hiLogLabel, "[%{public}s] : %{public}s", tag, message);
    }

    public static void e(String tag, String message, Throwable throwable) {
        HiLog.debug(hiLogLabel, "[%{public}s] : %{public}s ===> %{public}s", tag, message, HiLog.getStackTrace(throwable));
    }

    public static void i(String tag, String message) {
        HiLog.info(hiLogLabel, "[%{public}s] : %{public}s", tag, message);
    }

    public static void i(String tag, String message, Throwable throwable) {
        HiLog.debug(hiLogLabel, "[%{public}s] : %{public}s ===> %{public}s", tag, message, HiLog.getStackTrace(throwable));
    }

    public static void w(String tag, String message) {
        HiLog.warn(hiLogLabel, "[%{public}s] : %{public}s", tag, message);
    }

    public static void w(String tag, String message, Throwable throwable) {
        HiLog.debug(hiLogLabel, "[%{public}s] : %{public}s ===> %{public}s", tag, message, HiLog.getStackTrace(throwable));
    }
}
